import 'package:oramemo/generated/json/base/json_convert_content.dart';
import 'package:oramemo/entity/app_version_entity.dart';

AppVersionEntity $AppVersionEntityFromJson(Map<String, dynamic> json) {
  final AppVersionEntity appVersionEntity = AppVersionEntity();
  final String? msg = jsonConvert.convert<String>(json['msg']);
  if (msg != null) {
    appVersionEntity.msg = msg;
  }
  final int? code = jsonConvert.convert<int>(json['code']);
  if (code != null) {
    appVersionEntity.code = code;
  }
  final AppVersionData? data = jsonConvert.convert<AppVersionData>(
      json['data']);
  if (data != null) {
    appVersionEntity.data = data;
  }
  return appVersionEntity;
}

Map<String, dynamic> $AppVersionEntityToJson(AppVersionEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['msg'] = entity.msg;
  data['code'] = entity.code;
  data['data'] = entity.data?.toJson();
  return data;
}

extension AppVersionEntityExtension on AppVersionEntity {
  AppVersionEntity copyWith({
    String? msg,
    int? code,
    AppVersionData? data,
  }) {
    return AppVersionEntity()
      ..msg = msg ?? this.msg
      ..code = code ?? this.code
      ..data = data ?? this.data;
  }
}

AppVersionData $AppVersionDataFromJson(Map<String, dynamic> json) {
  final AppVersionData appVersionData = AppVersionData();
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    appVersionData.createTime = createTime;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    appVersionData.updateTime = updateTime;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    appVersionData.remark = remark;
  }
  final AppVersionDataParams? params = jsonConvert.convert<
      AppVersionDataParams>(json['params']);
  if (params != null) {
    appVersionData.params = params;
  }
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    appVersionData.id = id;
  }
  final String? version = jsonConvert.convert<String>(json['version']);
  if (version != null) {
    appVersionData.version = version;
  }
  final int? platform = jsonConvert.convert<int>(json['platform']);
  if (platform != null) {
    appVersionData.platform = platform;
  }
  final String? downUrl = jsonConvert.convert<String>(json['downUrl']);
  if (downUrl != null) {
    appVersionData.downUrl = downUrl;
  }
  final String? describe = jsonConvert.convert<String>(json['describe']);
  if (describe != null) {
    appVersionData.describe = describe;
  }
  final int? mustRenew = jsonConvert.convert<int>(json['mustRenew']);
  if (mustRenew != null) {
    appVersionData.mustRenew = mustRenew;
  }
  return appVersionData;
}

Map<String, dynamic> $AppVersionDataToJson(AppVersionData entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['createTime'] = entity.createTime;
  data['updateTime'] = entity.updateTime;
  data['remark'] = entity.remark;
  data['params'] = entity.params?.toJson();
  data['id'] = entity.id;
  data['version'] = entity.version;
  data['platform'] = entity.platform;
  data['downUrl'] = entity.downUrl;
  data['describe'] = entity.describe;
  data['mustRenew'] = entity.mustRenew;
  return data;
}

extension AppVersionDataExtension on AppVersionData {
  AppVersionData copyWith({
    String? createTime,
    String? updateTime,
    String? remark,
    AppVersionDataParams? params,
    int? id,
    String? version,
    int? platform,
    String? downUrl,
    String? describe,
    int? mustRenew,
  }) {
    return AppVersionData()
      ..createTime = createTime ?? this.createTime
      ..updateTime = updateTime ?? this.updateTime
      ..remark = remark ?? this.remark
      ..params = params ?? this.params
      ..id = id ?? this.id
      ..version = version ?? this.version
      ..platform = platform ?? this.platform
      ..downUrl = downUrl ?? this.downUrl
      ..describe = describe ?? this.describe
      ..mustRenew = mustRenew ?? this.mustRenew;
  }
}

AppVersionDataParams $AppVersionDataParamsFromJson(Map<String, dynamic> json) {
  final AppVersionDataParams appVersionDataParams = AppVersionDataParams();
  return appVersionDataParams;
}

Map<String, dynamic> $AppVersionDataParamsToJson(AppVersionDataParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  return data;
}

extension AppVersionDataParamsExtension on AppVersionDataParams {
}